package com.qys.livesMall.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qys.livesMall.framework.view.BaseQuery;
import com.qys.livesMall.shop.modal.entity.SysOperateReportForms;
import com.qys.livesMall.shop.mapper.SysOperateReportFormsMapper;
import com.qys.livesMall.shop.service.SysOperateReportFormsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 报表管理-运营报表 服务实现类
 * </p>
 *
 * @author 
 * @since 2023-12-08
 */
@Service
public class SysOperateReportFormsServiceImpl extends ServiceImpl<SysOperateReportFormsMapper, SysOperateReportForms> implements SysOperateReportFormsService {

    @Override
    public Page<SysOperateReportForms> page(BaseQuery baseQuery) {
        Page<SysOperateReportForms> page = Page.of(baseQuery.getPageNum(), baseQuery.getPageSize());
        LambdaQueryWrapper<SysOperateReportForms> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.ge(null!=baseQuery.getStartTime(),SysOperateReportForms::getDate,baseQuery.getStartTime().toLocalDate());
        queryWrapper.le(null!=baseQuery.getEndTime(),SysOperateReportForms::getDate,baseQuery.getEndTime().toLocalDate());
        return page(page,queryWrapper);
    }
}
